package net.fenghaitao.enums;

import lombok.Getter;

/**
 * @author ：HuangXiong
 * @date ：Created in 2021/1/11 11:19
 * @description：
 * @modified By：
 * @version:
 */
public enum AutoExcelCellType {
    /**
     *
     */
    DEFAULT("", "\\."),
    FORMULA("formula", "_"),
    ROW_NO("rowno", ""),
    ;

    @Getter
    private String typeName;
    @Getter
    private String splitStr;

    /**
     * 默认的数组长度
     */
    private final int DEF_ARR_LEN = 2;

    AutoExcelCellType(String typeName, String splitStr) {
        this.typeName = typeName;
        this.splitStr = splitStr;
    }

    public String[] getArr( String str, int arrLen) {
        return str.split(this.splitStr, arrLen);
    }

    public String[] getArr( String str) {
        return getArr( str, DEF_ARR_LEN);
    }
}
